# 输入一个年，在输入一个月，输出该月的天数


def check(year, month):
    if year.isdigit() and month.isdigit():
        if int(month) in  list(range(1,13)):
            return True
    else:
        False
def run_year(year, month):
    month_list = [31,28,31,30,31,30,31,31,30,31,30,31]
    month_list_run = [31,29,31,30,31,30,31,31,30,31,30,31]
    year = int(year)
    month = int(month)
    if year % 4 == 0 and year % 100 != 0:
        print(month_list_run[month-1])
    else:
        print(month_list[month-1])



if __name__ == "__main__":   
    year = input("输入年：")
    month = input("输入月：")
    if check(year, month):
        run_year(year, month)
    else:
        print("输入错误")



